<html>
<script>
	
</script>
<head>
<link type="text/css" rel="styleSheet" href="css/default.css" />
<link type="text/css" rel="styleSheet" href="css/css.css" />
<script src="js/vue.min.js"></script>
<script src="js/axios.min.js"></script>
<script src="js/vue-cookies.js"></script>
</head>
<body>
	<div id="app">
			标题:<br><input v-model="title" style="width:600px" placeholder="标题"></input> <br> 
			正文:<br><textarea v-model="content" style="width:600px;height:300px"></textarea><br>
			<button v-on:click="adda" btncolor="blue" btnsize="l">发布</button>
	</div>
</body>
<script>
var userid = window.$cookies.get("userid");
	var vm = new Vue({
		el:"#app",
		data:{
			title:"",
			content:""
		},
		methods:{
			adda:function(){
				if(userid==null){alert("请先登录")}else{
				var that=this;
				axios({
					url:'http://localhost/adda',
					method:'post',
					data:{
						author:userid,
						title:that.title,
						content:that.content
					}
				
				}).then(function(resp){
					if(resp){
						alert("发布成功");
					}
				});}
			}
		}
	});
</script>
</html>